<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>C++ Web Framework: SqlQuery Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">C++ Web Framework
   &#160;<span id="projectnumber">3.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_sql_query-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">SqlQuery Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>The <a class="el" href="class_sql_query.html" title="The SqlQuery class was created to facilitate integration with SqlDataBaseStorage and manipulation to ...">SqlQuery</a> class was created to facilitate integration with SqlDataBaseStorage and manipulation to the database through JSON.  
 <a href="class_sql_query.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="sqlquery_8h_source.html">sqlquery.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for SqlQuery:</div>
<div class="dyncontent">
<div class="center"><img src="class_sql_query__inherit__graph.png" border="0" usemap="#_sql_query_inherit__map" alt="Inheritance graph"/></div>
<!-- MAP 0 -->
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a81ec51c1f78134ed0d5016774335460c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sql_query.html#a81ec51c1f78134ed0d5016774335460c">SqlQuery</a> (<a class="el" href="class_sql_database_storage.html">SqlDatabaseStorage</a> &amp;dbStorage)</td></tr>
<tr class="memdesc:a81ec51c1f78134ed0d5016774335460c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a QSqlQuery object using the database dbStorage.  <a href="#a81ec51c1f78134ed0d5016774335460c">More...</a><br /></td></tr>
<tr class="separator:a81ec51c1f78134ed0d5016774335460c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2e52ed76e3683d7684fd792bec0b9a09"><td class="memItemLeft" align="right" valign="top">QJsonObject&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sql_query.html#a2e52ed76e3683d7684fd792bec0b9a09">exec</a> ()</td></tr>
<tr class="memdesc:a2e52ed76e3683d7684fd792bec0b9a09"><td class="mdescLeft">&#160;</td><td class="mdescRight">Executes and returns a JSON indicating success, or failure through the key success.  <a href="#a2e52ed76e3683d7684fd792bec0b9a09">More...</a><br /></td></tr>
<tr class="separator:a2e52ed76e3683d7684fd792bec0b9a09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5fa16018f76ee798660343bc5fabe8a0"><td class="memItemLeft" align="right" valign="top">QJsonObject&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sql_query.html#a5fa16018f76ee798660343bc5fabe8a0">exec</a> (const QString &amp;query)</td></tr>
<tr class="memdesc:a5fa16018f76ee798660343bc5fabe8a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Executes a query and returns a JSON indicating success, or failure through the key "success" and "message".  <a href="#a5fa16018f76ee798660343bc5fabe8a0">More...</a><br /></td></tr>
<tr class="separator:a5fa16018f76ee798660343bc5fabe8a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f12c62fa99bb2f5738b54e5cbefa0f9"><td class="memItemLeft" align="right" valign="top">QJsonArray&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sql_query.html#a4f12c62fa99bb2f5738b54e5cbefa0f9">toJson</a> ()</td></tr>
<tr class="memdesc:a4f12c62fa99bb2f5738b54e5cbefa0f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the result of a select converted to a QJsonArray. If there is a failure, a JSON object with two fields will be returned: "success" and "message". If there are no results, QJsonArray will return a empty object.  <a href="#a4f12c62fa99bb2f5738b54e5cbefa0f9">More...</a><br /></td></tr>
<tr class="separator:a4f12c62fa99bb2f5738b54e5cbefa0f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5bf880f51ea330bbccc5815fac1430f2"><td class="memItemLeft" align="right" valign="top">QJsonObject&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sql_query.html#a5bf880f51ea330bbccc5815fac1430f2">deleteRecord</a> (const QString &amp;table, const QString &amp;condition)</td></tr>
<tr class="memdesc:a5bf880f51ea330bbccc5815fac1430f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete a record given a table and a condition. Returns a JSON indicating success, or failure through the key "success" and "message".  <a href="#a5bf880f51ea330bbccc5815fac1430f2">More...</a><br /></td></tr>
<tr class="separator:a5bf880f51ea330bbccc5815fac1430f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad831477c3ce9914f7dcd8136e72af387"><td class="memItemLeft" align="right" valign="top">QJsonObject&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sql_query.html#ad831477c3ce9914f7dcd8136e72af387">insertFromJson</a> (const QJsonObject &amp;json, const QString &amp;table)</td></tr>
<tr class="memdesc:ad831477c3ce9914f7dcd8136e72af387"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insert a record given a json and a table. Returns a JSON indicating success, or failure through the key "success" and "message".  <a href="#ad831477c3ce9914f7dcd8136e72af387">More...</a><br /></td></tr>
<tr class="separator:ad831477c3ce9914f7dcd8136e72af387"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a57821078a46629590e01e3645af13edf"><td class="memItemLeft" align="right" valign="top">QJsonObject&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_sql_query.html#a57821078a46629590e01e3645af13edf">updateFromJson</a> (const QJsonObject &amp;json, const QString &amp;table, const QString &amp;condition)</td></tr>
<tr class="memdesc:a57821078a46629590e01e3645af13edf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Update a record given a json, a table and a condition. Returns a JSON indicating success, or failure through the key "success" and "message".  <a href="#a57821078a46629590e01e3645af13edf">More...</a><br /></td></tr>
<tr class="separator:a57821078a46629590e01e3645af13edf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The <a class="el" href="class_sql_query.html" title="The SqlQuery class was created to facilitate integration with SqlDataBaseStorage and manipulation to ...">SqlQuery</a> class was created to facilitate integration with SqlDataBaseStorage and manipulation to the database through JSON. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a81ec51c1f78134ed0d5016774335460c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a81ec51c1f78134ed0d5016774335460c">&#9670;&nbsp;</a></span>SqlQuery()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">CWF_BEGIN_NAMESPACE SqlQuery::SqlQuery </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_sql_database_storage.html">SqlDatabaseStorage</a> &amp;&#160;</td>
          <td class="paramname"><em>dbStorage</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs a QSqlQuery object using the database dbStorage. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dbStorage</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a5bf880f51ea330bbccc5815fac1430f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5bf880f51ea330bbccc5815fac1430f2">&#9670;&nbsp;</a></span>deleteRecord()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QJsonObject SqlQuery::deleteRecord </td>
          <td>(</td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"><em>table</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"><em>condition</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Delete a record given a table and a condition. Returns a JSON indicating success, or failure through the key "success" and "message". </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">table</td><td></td></tr>
    <tr><td class="paramname">condition</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>QJsonObject </dd></dl>

</div>
</div>
<a id="a2e52ed76e3683d7684fd792bec0b9a09"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2e52ed76e3683d7684fd792bec0b9a09">&#9670;&nbsp;</a></span>exec() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QJsonObject SqlQuery::exec </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Executes and returns a JSON indicating success, or failure through the key success. </p>
<dl class="section return"><dt>Returns</dt><dd>QJsonObject </dd></dl>

</div>
</div>
<a id="a5fa16018f76ee798660343bc5fabe8a0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5fa16018f76ee798660343bc5fabe8a0">&#9670;&nbsp;</a></span>exec() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QJsonObject SqlQuery::exec </td>
          <td>(</td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"><em>query</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Executes a query and returns a JSON indicating success, or failure through the key "success" and "message". </p>
<dl class="section return"><dt>Returns</dt><dd>QJsonObject </dd></dl>

</div>
</div>
<a id="ad831477c3ce9914f7dcd8136e72af387"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad831477c3ce9914f7dcd8136e72af387">&#9670;&nbsp;</a></span>insertFromJson()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QJsonObject SqlQuery::insertFromJson </td>
          <td>(</td>
          <td class="paramtype">const QJsonObject &amp;&#160;</td>
          <td class="paramname"><em>json</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"><em>table</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Insert a record given a json and a table. Returns a JSON indicating success, or failure through the key "success" and "message". </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">json</td><td></td></tr>
    <tr><td class="paramname">table</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>QJsonObject </dd></dl>

</div>
</div>
<a id="a4f12c62fa99bb2f5738b54e5cbefa0f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4f12c62fa99bb2f5738b54e5cbefa0f9">&#9670;&nbsp;</a></span>toJson()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QJsonArray SqlQuery::toJson </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the result of a select converted to a QJsonArray. If there is a failure, a JSON object with two fields will be returned: "success" and "message". If there are no results, QJsonArray will return a empty object. </p>
<dl class="section return"><dt>Returns</dt><dd>QJsonArray </dd></dl>

</div>
</div>
<a id="a57821078a46629590e01e3645af13edf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a57821078a46629590e01e3645af13edf">&#9670;&nbsp;</a></span>updateFromJson()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QJsonObject SqlQuery::updateFromJson </td>
          <td>(</td>
          <td class="paramtype">const QJsonObject &amp;&#160;</td>
          <td class="paramname"><em>json</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"><em>table</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"><em>condition</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Update a record given a json, a table and a condition. Returns a JSON indicating success, or failure through the key "success" and "message". </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">json</td><td></td></tr>
    <tr><td class="paramname">table</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>QJsonObject </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/home/herik/CPPWebFramework/CPPWebFramework/cwf/<a class="el" href="sqlquery_8h_source.html">sqlquery.h</a></li>
<li>/home/herik/CPPWebFramework/CPPWebFramework/cwf/sqlquery.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon May 28 2018 11:09:09 for C++ Web Framework by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
